package com.cnpc.rightslogan.controller;

import com.cnpc.rightslogan.entity.Organization;
import com.cnpc.rightslogan.feign.IOrganizationClientService;
import com.cnpc.rightslogan.utils.common.BaseController;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * Created by Administrator on 2017/9/13.
 */
@RestController
@RequestMapping("/organization")
@Api("OrganizationController相关的api")
@Slf4j
public class OrganizationClientController extends BaseController {

    @Resource
    private IOrganizationClientService organizationClientService;

    @ApiOperation(value = "获取所有数据，分页获取", notes = "{\"isdelete\":0,\"pageNum\":1,\"pageSize\":10}")
    @ResponseBody
    @PostMapping("/list")
    public PageInfo<Organization> getOrganizationList(
            @RequestBody @ApiParam(name = "json", value = "分页对象及User对象json串",
                    example = "{\"isdelete\":0,\"pageNum\":1,\"pageSize\":10}") String json) {
        log.info("User模块-获取所有数据");
        return organizationClientService.getOrganizationList(json);
    }
}